//
//  LSZPlayerOfferViewController.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/7/19.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZPlayerOfferViewController.h"

@interface LSZPlayerOfferViewController ()

@end

@implementation LSZPlayerOfferViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSURL * mediaURL = [NSURL fileURLWithPath:self.url];
    AVPlayerItem * item = [AVPlayerItem playerItemWithURL:mediaURL];
    AVPlayer * myPlayer = [AVPlayer playerWithPlayerItem:item];
    AVPlayerLayer *  playerLayer = [AVPlayerLayer playerLayerWithPlayer:myPlayer];
    playerLayer.frame = CGRectMake(0, 0, self.view.bounds.size.width, 300);
    [self.view.layer addSublayer: playerLayer];

    [myPlayer play];
}

@end
